cmake_minimum_required(VERSION 3.22.1)
project(sunnet)

# 添加源码（更推荐显式列出文件，而非 aux_source_directory）
file(GLOB DIR_SRCS CONFIGURE_DEPENDS src/*.cpp)

add_executable(sunnet ${DIR_SRCS})

# 包含目录
target_include_directories(sunnet PRIVATE
    include
    ${CMAKE_CURRENT_SOURCE_DIR}/3rd/lua-5.3.5/src
)

# C++11 标准
target_compile_features(sunnet PRIVATE cxx_std_11)

# 线程库
find_package(Threads REQUIRED)
target_link_libraries(sunnet PRIVATE Threads::Threads)

# Lua 库（假设库文件是 liblua.a）
target_link_libraries(sunnet PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/3rd/lua-5.3.5/src/liblua.a
    ${CMAKE_DL_LIBS}
)